Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paring heap without shared_ptr #1707

Closed
wants to merge 1 commit into from
Closed

Conversation

jere8184
Copy link
Contributor

@jere8184 jere8184 commented Nov 7, 2024

fixes #1675

@jere8184

This comment was marked as duplicate.

@jere8184
Copy link
Contributor Author

jere8184 commented Nov 8, 2024

@heinezen @TheJJ Hopefully this is along the right lines, One issue I've noticed is that unlink_node will leave the user of the function with a node that they will have to then manually delete unless the node is pushed back into the heap at least with my current implementation.

@jere8184 jere8184 force-pushed the paring_heap branch 7 times, most recently from a18ba68 to fb52b9f Compare November 10, 2024 14:34
@jere8184
Copy link
Contributor Author

jere8184 commented Nov 10, 2024

unlink_node is now private. remove_node method added. 32% performance increase observed.

@heinezen heinezen linked an issue Nov 18, 2024 that may be closed by this pull request
2 tasks
Copy link
Member

@heinezen heinezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few problems.

libopenage/datastructure/pairing_heap.h Outdated Show resolved Hide resolved
Comment on lines 323 to 321
#if OPENAGE_PAIRINGHEAP_DEBUG
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code block does nohing now

libopenage/datastructure/pairing_heap.h Outdated Show resolved Hide resolved
libopenage/datastructure/pairing_heap.h Outdated Show resolved Hide resolved
@heinezen heinezen added improvement Enhancement of an existing component lang: c++ Done in C++ code area: util Utilitis and data structures labels Nov 19, 2024
@TheJJ TheJJ changed the title Paring heap Paring heap without shared_ptr Nov 19, 2024
@jere8184 jere8184 force-pushed the paring_heap branch 2 times, most recently from 03571e7 to b286c0c Compare November 20, 2024 19:30
Copy link
Member

@heinezen heinezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one addtional suggestion and then we can merge.

The rest of the code seems to work out fine :)

libopenage/datastructure/pairing_heap.h Show resolved Hide resolved
@jere8184 jere8184 closed this by deleting the head repository Nov 24, 2024
@jere8184
Copy link
Contributor Author

I think I may have made a small mistake :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: util Utilitis and data structures improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement pairing heap without shared_ptr
2 participants